import 'package:flutter/material.dart';

class AuthorNotePage extends StatefulWidget {
  final int id;

  const AuthorNotePage({Key? key,required this.id}) : super(key: key);

  @override
  _AuthorNotePageState createState() => _AuthorNotePageState();
}

class _AuthorNotePageState extends State<AuthorNotePage>
    with AutomaticKeepAliveClientMixin {
  @override
  Widget build(BuildContext context) {
    return Container(
        color: Colors.brown,
        child: MediaQuery.removePadding(
          context: context,
          removeTop: true,
          child: ListView.builder(
              ///禁用滑动事件
              physics: AlwaysScrollableScrollPhysics(),
              itemCount: 11,
              itemBuilder: (BuildContext context, int index) {
                return _itemCell(index);
              }),
        ));
  }

  Widget _itemCell(int index) {
    return Container(
      color: Colors.red,
      height: 100,
    );
  }

  @override
  // TODO: implement wantKeepAlive
  bool get wantKeepAlive => true;
}
